<%
//用户
var user = shiro.getUser();
var title  = '食药局申请-经办人';
layout("/inc/layout.html",{
title:title,
keywords:title,
description:title,
style:'user.css'
}){
%>
    <section class="container">
        <div class="row  mt15">
        <div class="panel panel-info">
			<div class="panel-heading text-left">
				<ul class="nav nav-tabs">
					<li class="active"><a href="/fooddrugApply/base"><b>食品经营许可证办理</b></a></li>
					<li><a href="/fooddrugChange/index"><b>食品经营许可证变更</b></a></li>
					<li><a href="/fooddrugCancel/base"><b>食品经营许可证注销</b></a></li>
				</ul>
			</div>
			<div class="panel-body">
                <!--项目状态-->
  <legend><span class="text text-danger" id="messageCode">经办人登记</span></legend>
                <form class="form-horizontal col-sm-offset-1 col-sm-9" id="saveAgentForm" method="post" action="/fooddrugApply/saveAgent">
                   <input type="hidden" name="id" id="id" value="${id!}">
                  <input type="hidden" name="applyId" id="applyId" value="${applyId!}">
                    <div class="form-group">
                        <label for="companyName" class="col-sm-2 control-label">姓名：</label>
                        <div class="col-sm-10">               
                            <input type="text" class="form-control" id="name" name="name" value="${name!}" placeholder="经办人姓名"
                                   required="required"> 
                                    <b class="text text-danger" id="name-error"></b>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-2 control-label">证件类型：</label>
                        <div class="col-sm-10" id="distpicker">
                            <select class="form-control" name="cardType" id="cardType">
                             <option value="1"  ${cardType==1? "selected"} >身份证</option>
                             <option value="2" ${cardType==2? "selected"}>营业执照副本</option>
                             <option value="3" ${cardType==3? "selected"}>其他有效证件</option>
                            </select>
                             <b class="text text-danger" id="cardType-error"></b>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="companyName" class="col-sm-2 control-label">证件号码：</label>
                        <div class="col-sm-10">               
                            <input type="text" class="form-control" id="cardNumber" name="cardNumber" value="${cardNumber!}" placeholder="经办人证件号码"
                                   required="required"> 
                                    <b class="text text-danger" id="cardNumber-error"></b>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label for="companyName" class="col-sm-2 control-label">手机号码：</label>
                        <div class="col-sm-10">               
                            <input type="text" class="form-control" id="phone" name="phone" value="${phone!}" placeholder="经办人手机号码"
                                   required="required"> 
                                    <b class="text text-danger" id="phone-error"></b>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label for="companyName" class="col-sm-2 control-label">电子邮箱：</label>
                        <div class="col-sm-10">               
                            <input type="text" class="form-control" id="email" name="email" value="${email!}" placeholder="经办人电子邮箱"
                                   required="required"> 
                                    <b class="text text-danger" id="email-error"></b>
                        </div>
                    </div>
                    
                   <div class="form-group">
                        <label for="cardUploader" class="col-sm-2 control-label">身份证照片：</label>
                        <div class="col-sm-5" id="cardFrontPicture-box">
                            <input type="file" class="form-control" id="cardFrontPictureUploader" name="files" data-max-file-count="5" multiple="multiple">
                            <b class="text text-danger" id="cardFrontPicture-error"></b>
                             <hr></hr>
                            <span class="test-block" id="cardFrontPicture-upload-error"></span>
                            <div id="cardFrontPicture-upload-success">
                            <%
                                if(isNotEmpty(cardFrontPicture)){
                                 %>
                                <div>
                                    <div class="thumbnail uploadImageShow">
                                        <input type="hidden" name="cardFrontPicture" value="${cardFrontPicture!}">
                                        <a href="${uploaderFilesDomain!}${cardFrontPicture!}" target="_blank">
                                            <img src="${uploaderFilesDomain!}${cardFrontPicture!}">
                                        </a>
                                         <div class="btn btn-block btn-danger deletetCover" onclick="$(this).parent().parent().remove();">删除</div>
                                    </div>
                                </div>
                                <%
                                 }
                                %>
                            </div>
                        </div>
                        <div class="col-sm-5" id="cardBackPicture-box">
                            <input type="file" class="form-control" id="cardBackPictureUploader" name="files" data-max-file-count="5" multiple="multiple">
                            <b class="text text-danger" id="cardBackPicture-error"></b>
                             <hr></hr>
                            <span class="cardBackPicture-block" id="cardBackPicture-upload-error"></span>
                            <div id="cardBackPicture-upload-success">
                            <%
                                if(isNotEmpty(cardBackPicture)){
                                 %>
                                <div>
                                    <div class="thumbnail uploadImageShow">
                                        <input type="hidden" name="cardBackPicture" value="${cardBackPicture!}">
                                        <a href="${uploaderFilesDomain!}${cardBackPicture!}" target="_blank">
                                            <img src="${uploaderFilesDomain!}${cardBackPicture!}">
                                        </a>
                                         <div class="btn btn-block btn-danger deletetCover" onclick="$(this).parent().parent().remove();">删除</div>
                                    </div>
                                </div>
                                <%
                                 }
                                %>
                            </div>
                        </div>
                    </div>
                </form>
               </div>
              <div class="panel-footer">
                <div class="col-sm-offset-3 clearfix">
                    <div class="mt5 mb5 block col-sm-3">
                        <a href="/fooddrugApply/base/${applyId}" class="btn btn-warning btn-lg btn-outline btn-block">上一步</a>
                    </div>
                    <div class="mt5 mb5 block col-sm-3">
                        <button type="button" id="submitAgent" class="btn btn-danger btn-lg btn-outline btn-block">下一步</button>
                    </div>
                </div>
            </div>
         </div>
        </div>
    </section>
<% } %>
<script>
    require(['modules/fooddrug_agent'], function (fooddrugAgent) {
    	fooddrugAgent.info();
    });
</script>
</body>
</html>